/*     */ package com.yc.web;
/*     */ 
/*     */ import com.yc.dao.model.FiberInfoBO;
/*     */ import com.yc.dao.model.FiberLinkBO;
/*     */ import com.yc.dao.model.FiberUsedInfoBO;
/*     */ import com.yc.dao.model.FibercoreBO;
/*     */ import com.yc.dao.model.SectionInfoBo;
/*     */ import com.yc.dao.model.SectionOutInfoBO;
/*     */ import com.yc.service.FiberService;
/*     */ import com.yc.util.ExtTreeNode;
/*     */ import com.yc.util.ListContentsBFO;
/*     */ import java.io.PrintStream;
/*     */ import java.util.ArrayList;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import org.apache.commons.logging.Log;
/*     */ import org.apache.commons.logging.LogFactory;
/*     */ 
/*     */ public class FiberWeb
/*     */ {
/*  21 */   private static final Log log = LogFactory.getLog(FiberWeb.class);
/*  22 */   private FiberService fiberService = null;
/*  23 */   public static String LINK = "link";
/*  24 */   public static String SECTION = "section";
/*  25 */   public static String SECTION_OUT = "out";
/*  26 */   public static String FIBER_INFO = "FIBER";
/*  27 */   public static String FIBER_CORE = "fc";
/*  28 */   public static String FIBER_USED_INFO = "USED";
/*     */ 
/*     */   public FiberWeb() {
/*  31 */     this.fiberService = new FiberService();
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getFiblerLinkList(Map condition) {
/*  35 */     ListContentsBFO bfo = new ListContentsBFO();
/*  36 */     bfo = this.fiberService.getFiblerLinkList(condition);
/*  37 */     if (bfo.getData() == null) {
/*  38 */       List resultList = new ArrayList();
/*  39 */       bfo.setData(resultList.toArray());
/*  40 */       bfo.setTotalSize(0);
/*     */     }
/*  42 */     return bfo;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getFiblerLinkListForBrowse(Map condition) {
/*  46 */     ListContentsBFO bfo = new ListContentsBFO();
/*  47 */     bfo = this.fiberService.getFiblerLinkListForBrowse(condition);
/*  48 */     if (bfo.getData() == null) {
/*  49 */       List resultList = new ArrayList();
/*  50 */       bfo.setData(resultList.toArray());
/*  51 */       bfo.setTotalSize(0);
/*     */     }
/*  53 */     return bfo;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getSectionInfoList(Map condition) {
/*  57 */     ListContentsBFO bfo = this.fiberService.getSectionInfoList(condition);
/*  58 */     if (bfo.getData() == null) {
/*  59 */       List resultList = new ArrayList();
/*  60 */       bfo.setData(resultList.toArray());
/*  61 */       bfo.setTotalSize(0);
/*     */     }
/*  63 */     return bfo;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getSectionInfoListForBrowse(Map condition) {
/*  67 */     ListContentsBFO bfo = this.fiberService.getSectionInfoListForBrowse(condition);
/*  68 */     if (bfo.getData() == null) {
/*  69 */       List resultList = new ArrayList();
/*  70 */       bfo.setData(resultList.toArray());
/*  71 */       bfo.setTotalSize(0);
/*     */     }
/*  73 */     return bfo;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getOtherSectionInfoList(Map condition)
/*     */   {
/*  78 */     ListContentsBFO bfo = this.fiberService.getOtherSectionInfoList(condition);
/*  79 */     if (bfo.getData() == null) {
/*  80 */       List resultList = new ArrayList();
/*  81 */       bfo.setData(resultList.toArray());
/*  82 */       bfo.setTotalSize(0);
/*     */     }
/*  84 */     return bfo;
/*     */   }
/*     */ 
/*     */   public ExtTreeNode[] getFiblerAndSectionListTree(String strParendId, Map condition)
/*     */   {
/*  89 */     System.out.println("strParendId = " + strParendId);
/*  90 */     List list = this.fiberService.getFiblerAndSectionList(strParendId);
/*  91 */     ExtTreeNode[] treeNode = new ExtTreeNode[list.size()];
/*  92 */     list.toArray(treeNode);
/*  93 */     return treeNode;
/*     */   }
/*     */ 
/*     */   public boolean createFiberLink(FiberLinkBO bo) {
/*  97 */     boolean flag = false;
/*  98 */     if ("".equalsIgnoreCase(bo.getId())) {
/*  99 */       bo.setId(this.fiberService.queryMaxID(LINK));
/* 100 */       flag = this.fiberService.createFiberLink(bo);
/*     */     } else {
/* 102 */       flag = this.fiberService.updateFiberLink(bo);
/*     */     }
/* 104 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteFiberLink(String id) {
/* 108 */     return this.fiberService.deleteFiberLink(id);
/*     */   }
/*     */ 
/*     */   public boolean createSectionInfo(SectionInfoBo bo, String strOcName) {
/* 112 */     boolean flag = false;
/* 113 */     bo.setOcName(strOcName);
/* 114 */     if ((bo.getOcID() == null) || ("".equalsIgnoreCase(bo.getOcID()))) {
/* 115 */       bo.setOcID(this.fiberService.queryMaxID(SECTION));
/* 116 */       flag = this.fiberService.createSectionInfo(bo);
/*     */     } else {
/* 118 */       flag = this.fiberService.updateSectionInfo(bo);
/*     */     }
/* 120 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteSectionInfo(String strID) {
/* 124 */     return this.fiberService.deleteSectionInfo(strID);
/*     */   }
/*     */ 
/*     */   public boolean updateSectionInfoForLinkID(List ocidList, String strLinkID) {
/* 128 */     return this.fiberService.updateSectionInfoForLinkID(ocidList, strLinkID);
/*     */   }
/*     */ 
/*     */   public boolean deleteSectionInfoForLinkID(String strLinkId, String ocid) {
/* 132 */     return this.fiberService.deleteSectionInfoForLinkID(strLinkId, ocid);
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getSectionOutInfoList(Map condition) {
/* 136 */     ListContentsBFO bfo = this.fiberService.getSectionOutInfoList(condition);
/* 137 */     if (bfo.getData() == null) {
/* 138 */       List resultList = new ArrayList();
/* 139 */       bfo.setData(resultList.toArray());
/* 140 */       bfo.setTotalSize(0);
/*     */     }
/* 142 */     return bfo;
/*     */   }
/*     */ 
/*     */   public boolean createSectionOutInfo(SectionOutInfoBO bo) {
/* 146 */     boolean flag = false;
/* 147 */     if ((bo.getId() == null) || ("".equalsIgnoreCase(bo.getId()))) {
/* 148 */       bo.setId(this.fiberService.queryMaxID(SECTION_OUT));
/* 149 */       flag = this.fiberService.createSectionOutInfo(bo);
/*     */     } else {
/* 151 */       flag = this.fiberService.updateSectionOutInfo(bo);
/*     */     }
/* 153 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteSectionOutInfo(String strId, String strOcId) {
/* 157 */     return this.fiberService.deleteSectionOutInfo(strId, strOcId);
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getFiberInfoList(Map condition) {
/* 161 */     ListContentsBFO bfo = this.fiberService.getFiberInfoList(condition);
/* 162 */     if (bfo.getData() == null) {
/* 163 */       List resultList = new ArrayList();
/* 164 */       bfo.setData(resultList.toArray());
/* 165 */       bfo.setTotalSize(0);
/*     */     }
/* 167 */     return bfo;
/*     */   }
/*     */ 
/*     */   public FiberInfoBO getFiberInfoByOcId(String strOcid) {
/* 171 */     return this.fiberService.getFiberInfoByOcId(strOcid);
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getFiberUsedInfoList(Map condition) {
/* 175 */     ListContentsBFO bfo = this.fiberService.getFiberUsedInfoList(condition);
/* 176 */     if (bfo.getData() == null) {
/* 177 */       List resultList = new ArrayList();
/* 178 */       bfo.setData(resultList.toArray());
/* 179 */       bfo.setTotalSize(0);
/*     */     }
/* 181 */     return bfo;
/*     */   }
/*     */ 
/*     */   public boolean createFiberInfo(FiberInfoBO bo) {
/* 185 */     boolean flag = false;
/* 186 */     if ((bo.getFiberid() == null) || ("".equalsIgnoreCase(bo.getFiberid()))) {
/* 187 */       bo.setFiberid(this.fiberService.queryMaxID(FIBER_INFO));
/* 188 */       flag = this.fiberService.createFiberInfo(bo);
/*     */     } else {
/* 190 */       flag = this.fiberService.updateFiberInfo(bo);
/*     */     }
/* 192 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean createFiberCore(FibercoreBO bo) {
/* 196 */     boolean flag = false;
/* 197 */     if ((bo.getId() == null) || ("".equalsIgnoreCase(bo.getId()))) {
/* 198 */       bo.setId(this.fiberService.queryMaxID(FIBER_CORE));
/* 199 */       flag = this.fiberService.createFiberCore(bo);
/*     */     } else {
/* 201 */       flag = this.fiberService.updateFiberCore(bo);
/*     */     }
/* 203 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteFiberCore(String strId)
/*     */   {
/* 209 */     return this.fiberService.deleteFiberCore(strId);
/*     */   }
/*     */ 
/*     */   public boolean createFiberUsedInfo(FiberUsedInfoBO bo)
/*     */   {
/* 215 */     boolean flag = false;
/* 216 */     if ((bo.getId() == null) || ("".equalsIgnoreCase(bo.getId()))) {
/* 217 */       bo.setId(this.fiberService.queryMaxID(FIBER_USED_INFO));
/* 218 */       flag = this.fiberService.createFiberUsedInfo(bo);
/*     */     } else {
/* 220 */       flag = this.fiberService.updateFiberUsedInfo(bo);
/*     */     }
/* 222 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteFiberInfo(String strId) {
/* 226 */     return this.fiberService.deleteFiberInfo(strId);
/*     */   }
/*     */ 
/*     */   public FiberInfoBO getFiberInfo(String strFiberId) {
/* 230 */     return this.fiberService.getFiberInfo(strFiberId);
/*     */   }
/*     */ 
/*     */   public Map getSectionByIdOrOther(String strID) {
/* 234 */     return this.fiberService.getSectionByIdOrOther(strID);
/*     */   }
/*     */ 
/*     */   public List getSectionOutInfoListByID(String strOcID, String strSelectID, int zoomNumber) {
/* 238 */     List list = this.fiberService.getSectionOutInfoListByID(strOcID, strSelectID, zoomNumber);
/* 239 */     if ((list != null) && (list.size() > 0)) {
/* 240 */       return list;
/*     */     }
/* 242 */     return null;
/*     */   }
/*     */ 
/*     */   public List getSectionOutInfoListByInputValue(String strOcName, String strDistance) {
/* 246 */     return this.fiberService.getSectionOutInfoListByInputValue(strOcName, strDistance);
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getFiberCoreList(Map condition)
/*     */   {
/* 251 */     ListContentsBFO bfo = this.fiberService.getFiberCoreList(condition);
/* 252 */     if (bfo.getData() == null) {
/* 253 */       List resultList = new ArrayList();
/* 254 */       bfo.setData(resultList.toArray());
/* 255 */       bfo.setTotalSize(0);
/*     */     }
/* 257 */     return bfo;
/*     */   }
/*     */ 
/*     */   public void testFiberMap()
/*     */   {
/* 262 */     double lng = 104.52D;
/* 263 */     double lat = 30.329999999999998D;
/* 264 */     int outOrder = 1;
/* 265 */     for (int i = 0; i < 1000; i++)
/*     */     {
/* 267 */       SectionOutInfoBO bo = new SectionOutInfoBO();
/* 268 */       bo.setOcid("section201001150001");
/* 269 */       bo.setId(this.fiberService.queryMaxID(SECTION_OUT));
/* 270 */       bo.setOcName("成都-射洪");
/* 271 */       bo.setIsNode("0");
/* 272 */       bo.setIsRes("0");
/* 273 */       bo.setOcLayType("0");
/* 274 */       bo.setDistance("11");
/* 275 */       bo.setLongleath1("22");
/* 276 */       bo.setLongleath2("22");
/* 277 */       double rate = Double.parseDouble(String.valueOf(i)) / 100.0D;
/* 278 */       bo.setLat(String.valueOf(lat + rate));
/* 279 */       bo.setLng(String.valueOf(lng + rate));
/* 280 */       bo.setOutOrder(outOrder++);
/* 281 */       bo.setResLength("0");
/* 282 */       bo.setPoleNum("dddd");
/* 283 */       bo.setPropertyRight("fffff");
/* 284 */       this.fiberService.createSectionOutInfo(bo);
/*     */     }
/*     */   }
/*     */ 
/*     */   public boolean DeleteFiberUsedInfo(String strId)
/*     */   {
/* 291 */     return this.fiberService.DeleteFiberUsedInfo(strId);
/*     */   }
/*     */ 
/*     */   public boolean isFiberUsed(String strId) {
/* 295 */     return this.fiberService.isFiberUsed(strId);
/*     */   }
/*     */ 
/*     */   public boolean isSectionHaveFiber(String strID) {
/* 299 */     return this.fiberService.isSectionHaveFiber(strID);
/*     */   }
/*     */ 
/*     */   public boolean isUsedByLink(String strID) {
/* 303 */     return this.fiberService.isUsedByLink(strID);
/*     */   }
/*     */ 
/*     */   public boolean isLinkHaveSection(String strLinkId) {
/* 307 */     return this.fiberService.isLinkHaveSection(strLinkId);
/*     */   }
/*     */ 
/*     */   public void testDeleteSectionOutInfo()
/*     */   {
/* 313 */     this.fiberService.testDeleteSectionOutInfo("section201001150001");
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     com.yc.web.FiberWeb
 * JD-Core Version:    0.6.2
 */